<%--
  Created by IntelliJ IDEA.
  User: 22936
  Date: 2022/5/10
  Time: 19:30
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        .top {
            width: 100%;
            height: 50px;
            border: 1px solid;
            background-color: #337ab7;
        }

        img {
            width: 50px;
            height: 50px;
            margin-left: 5%;
        }

        a {
            text-decoration: none;
        }

        .lul {
            display: inline-block;
            width: 20%;
            height: 50px;
            list-style: none;
            position: absolute;
            left: 30px;
            margin-left: 10%;
        }

        .rul {
            display: inline-block;
            width: 20%;
            height: 50px;
            list-style: none;
            position: absolute;
            right: 30px;
        }

        .rul > li, .lul li {
            margin: 4.7% 10%;
            float: left;
        }

        .rul-child {
            position: absolute;
            bottom: -101%;
            list-style: none;
            display: none;
        }

        li {
            border: 1px solid royalblue;
            background-color: deepskyblue;
            border-radius: 3px;
        }
    </style>
</head>
<body>
<div class="top">
    <a href="${pageContext.request.contextPath}/user/allBook"><img src="jsp/../../static/img/MyShare.jpg"></a>
    <ul class="lul">
        <li>
            <a href="${pageContext.request.contextPath}/user/allBook">首页</a>
        </li>
        <li>
            <a href="#">spring</a>
        </li>
    </ul>
    <ul class="rul">
        <li>用户：<a href="${pageContext.request.contextPath}/user/userInfo" id="userName" >${sessionScope.get("uName")}</a></li>
        <li class="do">
            <a id="doing" onclick="show()">操作</a>
            <ul class="rul-child">
                <li><a href="${pageContext.request.contextPath}/register.jsp">注册</a></li>
                <li style="margin-top: 5px"><a href="${pageContext.request.contextPath}/user/exit">注销</a></li>
            </ul>
        </li>
    </ul>
</div>
<script src="${pageContext.request.contextPath}/static/js/jquery-3.4.1.min.js"></script>
<script>
    function show() {
        $(".rul-child").css("display", "block");
    }

    function seeInfo() {
        alert($("#userName").text());
        $.post({
            url: "${pageContext.request.contextPath}/user/userInfo",
            data: {'uName': $("#userName").innerText}
        });
    }
</script>
</body>
</html>
